<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template name="booleanValue">
		<xsl:param name="val"/>
		<xsl:choose>
			<xsl:when test="$val = 1 ">
				<xsl:text>Si</xsl:text>
			</xsl:when>
			<xsl:otherwise>
				<xsl:text>No</xsl:text>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
	<xsl:template name="dbServer">
		<xsl:param name="val"/>
		<xsl:if test="$val = 0 ">
			<tr><td><label>Server Virtuale:</label>
			<xsl:call-template name="booleanValue">
				<xsl:with-param name="val" select="dbserver_virtual"/>
			</xsl:call-template>
			</td></tr>
			<tr><td><label>Tipo virtualizzazione:</label><xsl:value-of select="dbserver_virtual_type"/></td></tr>
			<tr><td><label>CPU:</label><xsl:value-of select="dbserver_cpu"/></td></tr>
			<tr><td><label>Numero CPU:</label><xsl:value-of select="dbserver_n_cpu"/></td></tr>
			<tr><td><label>Sistema Operativo:</label><xsl:value-of select="dbserver_os"/></td></tr>
			<tr><td><label>64 bit:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="dbserver_64_bit"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Sistema Operativo:</label><xsl:value-of select="dbserver_os"/></td></tr>
			<tr><td><label>Ram free:</label><xsl:value-of select="dbserver_ram_free"/></td></tr>
			<tr><td><label>Tipologia raid:</label><xsl:value-of select="dbserver_raid"/></td></tr>
			<tr><td><label>Tipologia hd:</label><xsl:value-of select="dbserver_hd"/></td></tr>
			<tr><td><label>Installazione in Cluster (Fail-Over)</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="dbserver_cluster"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Quantità di GB liberi per Installazione e Repository Documentale</label><xsl:value-of select="dbserver_gb_inst"/></td></tr>
			<tr><td><label>Marca Server:</label><xsl:value-of select="dbserver_marca"/></td></tr>
			<tr><td><label>Modello:</label><xsl:value-of select="dbserver_modello"/></td></tr>
		</xsl:if>
	</xsl:template>
	
	<xsl:template match="/">
		<html>
		<header>
		<style>

		body {
			color: black;
			font-family: sans-serif;
			vertical-align: middle;
		}
		
		.modulo {
			width: 700px;
			margin-left: auto;
			margin-right: auto;
		}
		
		h1 {
			font-size: 22px;
			text-align: left;
			font-weight: normal;
		}
		
		h2 {
			font-size: 20px;
			text-align: center;
			font-weight: normal;
		}
		
		h3 {
			font-size: 18px;
			text-align: center;
			font-weight: normal;
			background-color: #E8E8E8;
			border-color: #E8E8E8;
		}
		
		label {
			margin: 5px;
			font-family: sans-serif;
			font-size: 12px;
			vertical-align: middle;
			font-weight: bold;
		}
		
		legend {
			margin: 5px;
			font-family: sans-serif;
			font-size: 24px;
		}
		
		table {	
			border-style: solid;
			border-width: 1px;
			border-color: gray;
			width: 100%;
			margin-left: auto;
			margin-right: auto;
			font-family: sans-serif;
			font-size: 14px;
			background-color: #E8E8E8;
		}
		
		tr {
			background-color: #E8E8E8;
			border-color: #E8E8E8;
		}
		
		</style>
		</header>
		<body>
			
		<xsl:for-each select="scheda_informativa">
		<div id="modulo" class="modulo">
		 <fieldset>
			<legend>Scheda informativa per Installazione Sicr@web</legend>
			<table>
			<tr><td><label>Cliente:</label><xsl:value-of select="cliente"/></td></tr>
			<tr><td><label>Data:</label><xsl:value-of select="data"/></td></tr>
			<tr><td><label>Riferimento:</label><xsl:value-of select="riferimento"/></td></tr>
			<tr><td><label>Riferimento email:</label><xsl:value-of select="riferimento_email"/></td></tr>
			</table>
			<h1>1. Application Server</h1>
			<table>
			<tr><td><label>Server Virtuale:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="appserver_virtual"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Tipo virtualizzazione:</label><xsl:value-of select="appserver_virtual_type"/></td></tr>
			<tr><td><label>CPU:</label><xsl:value-of select="appserver_cpu"/></td></tr>
			<tr><td><label>Numero CPU:</label><xsl:value-of select="appserver_n_cpu"/></td></tr>
			<tr><td><label>Sistema Operativo:</label><xsl:value-of select="appserver_os"/></td></tr>
			<tr><td><label>64 bit:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="appserver_64_bit"/>
				</xsl:call-template></td></tr>
			<tr><td><label>Ram free:</label><xsl:value-of select="appserver_ram_free"/></td></tr>
			<tr><td><label>Tipologia raid:</label><xsl:value-of select="appserver_raid"/></td></tr>
			<tr><td><label>Tipologia hd:</label><xsl:value-of select="appserver_hd"/></td></tr>
			<tr><td><label>Installazione in Cluster (Fail-Over)</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="appserver_cluster"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Quantità di GB liberi per Installazione e Repository Documentale</label><xsl:value-of select="appserver_gb_inst"/></td></tr>
			<tr><td><label>Marca Server:</label><xsl:value-of select="appserver_marca"/></td></tr>
			<tr><td><label>Modello:</label><xsl:value-of select="appserver_modello"/></td></tr>
			<tr><td><label>Elenco eventuali applicazioni già presenti</label></td></tr>
			<tr><td><label>1. </label><xsl:value-of select="appserver_app1"/></td></tr>
			<tr><td><label>2. </label><xsl:value-of select="appserver_app2"/></td></tr>
			<tr><td><label>3. </label><xsl:value-of select="appserver_app3"/></td></tr>
			<tr><td><label>4. </label><xsl:value-of select="appserver_app4"/></td></tr>
			<tr><td><label>5. </label><xsl:value-of select="appserver_app5"/></td></tr>
			</table>
			<h1>2. Database Server</h1>
			<table>
			<tr><td><label>Server Application e Database coincidono</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="dbserver_appserver"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Database già presente</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="dbserver_coincidono"/>
				</xsl:call-template>
			</td></tr>
			
			<xsl:call-template name="dbServer">
					<xsl:with-param name="val" select="dbserver_appserver"/>
			</xsl:call-template>
			
			<tr><td><label>Tipologia DB:</label><xsl:value-of select="dbserver_dbrms"/></td></tr>
			<tr><td><label>Elenco eventuali applicazioni già presenti</label></td></tr>
			<tr><td><label>1. </label><xsl:value-of select="dbserver_app1"/></td></tr>
			<tr><td><label>2. </label><xsl:value-of select="dbserver_app2"/></td></tr>
			<tr><td><label>3. </label><xsl:value-of select="dbserver_app3"/></td></tr>
			<tr><td><label>4. </label><xsl:value-of select="dbserver_app4"/></td></tr>
			<tr><td><label>5. </label><xsl:value-of select="dbserver_app5"/></td></tr>
			</table>
			<h1>3. Sedi Remote</h1>
			<table>
			<tr><td><label>Sedi Remote:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="sedi_remote"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>N° Sedi Remote:</label><xsl:value-of select="sedi_n_sedi"/></td></tr>
			<tr><td><label>Connettività MINIMA GARANTITA sedi remote:</label><xsl:value-of select="sedi_connettivita"/></td></tr>
			<tr><td><label>N° Postazioni per sede:</label><xsl:value-of select="sedi_n_post_remote"/></td></tr>
			<tr><td><label>N° abitanti comune (stima):</label><xsl:value-of select="sedi_n_abitanti"/></td></tr>
			</table>
			<h1>4. Backup</h1>
			<table>
			<tr><td><label>Già presente e utilizzato:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="backup_presente"/>
				</xsl:call-template>
			</td></tr>
			<tr><td><label>Acquistato o da acquistare appositamente per Sicraweb:</label>
				<xsl:call-template name="booleanValue">
					<xsl:with-param name="val" select="backup_apposito"/>
				</xsl:call-template>
			</td></tr>
			</table>
			<h1>5. Note</h1>
			<table>
			<tr><td><label>Note:</label>
				<xsl:value-of select="note"/>
			</td></tr>
			</table>
			<h2 align="center" >Valutazione Hardware</h2>
			<h3><xsl:value-of select="valutazione"/></h3><h3><xsl:value-of select="punteggio"/></h3>
		</fieldset>
		</div>
		</xsl:for-each>
		</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
